package com.teasale.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

/**
 * 订单商品表
 * @TableName order_goods
 */
@TableName(value ="order_goods")
public class OrderGoods implements Serializable {
    /**
     * 订单商品唯一标识
     */
    @TableId(type = IdType.AUTO)
    private Integer ogId;

    /**
     * 商品编号
     */
    private String goodsId;

    /**
     * 订单编号
     */
    private String orderId;

    /**
     * 购买数量
     */
    private Integer ogNum;

    /**
     * 总价
     */
    private Double odPrice;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 订单商品唯一标识
     */
    public Integer getOgId() {
        return ogId;
    }

    /**
     * 订单商品唯一标识
     */
    public void setOgId(Integer ogId) {
        this.ogId = ogId;
    }

    /**
     * 商品编号
     */
    public String getGoodsId() {
        return goodsId;
    }

    /**
     * 商品编号
     */
    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    /**
     * 订单编号
     */
    public String getOrderId() {
        return orderId;
    }

    /**
     * 订单编号
     */
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    /**
     * 购买数量
     */
    public Integer getOgNum() {
        return ogNum;
    }

    /**
     * 购买数量
     */
    public void setOgNum(Integer ogNum) {
        this.ogNum = ogNum;
    }

    /**
     * 总价
     */
    public Double getOdPrice() {
        return odPrice;
    }

    /**
     * 总价
     */
    public void setOdPrice(Double odPrice) {
        this.odPrice = odPrice;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OrderGoods other = (OrderGoods) that;
        return (this.getOgId() == null ? other.getOgId() == null : this.getOgId().equals(other.getOgId()))
            && (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId()))
            && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getOgNum() == null ? other.getOgNum() == null : this.getOgNum().equals(other.getOgNum()))
            && (this.getOdPrice() == null ? other.getOdPrice() == null : this.getOdPrice().equals(other.getOdPrice()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOgId() == null) ? 0 : getOgId().hashCode());
        result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode());
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getOgNum() == null) ? 0 : getOgNum().hashCode());
        result = prime * result + ((getOdPrice() == null) ? 0 : getOdPrice().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", ogId=").append(ogId);
        sb.append(", goodsId=").append(goodsId);
        sb.append(", orderId=").append(orderId);
        sb.append(", ogNum=").append(ogNum);
        sb.append(", odPrice=").append(odPrice);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}